import {get, post, del, put} from "@/apis/http/request";
import {Admin, AdminUpdatePassRequest} from "@/apis/model/system/AdminModel";

/**
 * 得到菜单分页列表
 * @param params
 */
export const adminPage = (params: any) => post("/admin/page", params)

/**
 * 删除数据
 * @param id 
 * @returns 
 */
export const deleteAdminById = (id: number) => del("/admin/delete/"+ id)

/**
 * 新增数据
 * @param param
 */
export const insertAdmin = (param: Admin) => post("/admin", param)

/**
 * 更新数据
 * @param param
 */
export const updateAdmin = (param: Admin) => put("/admin", param)

/**
 * 得到详情
 * @param id
 */
export const getAdmin =  (id: number) => get("/admin/"+ id)

/**
 * 修改密码
 * @param param 修改参数
 * @returns 返回是否成功
 */
export const updatePassword = (param: AdminUpdatePassRequest) => post("/admin/updateP", param)